-- chatService管理聊天消息
local skynet = require "skynet"
require "ChatManager"
require "ChatRecord"

local CMD = {}
local cm = ChatManager:new()

function CMD.addRecord(userSend, userRec, content)
    cm:AddRecord(userSend, userRec, content)
end

function CMD.getRecords(userSend, userRec)
    local res = cm:GetRecods(userSend, userRec)
    return res
end

function CMD.start(conf)
end

skynet.start(function()
    skynet.dispatch("lua", function(_, _, command, ...)
        print("userManager Command:", command)
        local f = CMD[command]
        skynet.ret(skynet.pack(f(...)))
    end)
end)
